const nodemailer = require('nodemailer')
function sendEmail(account, yzm) {
    console.log("我被执行了", yzm);
    // 创建 nodemailer 配置
    let transporter = nodemailer.createTransport({
        //支持列表： https://nodemailer.com/smtp/well-known/
        service: 'QQ',
        port: 465, // SMTP 端口 这个不用管
        secureConnection: true,
        auth: {
            user: '2581532564@qq.com',
            pass: 'wxplknmjiishebff',
        }
    })
    let mailOptions = {
        from: '"LookLookWorld" <2581532564@qq.com>',
        to: account,// 
        subject: '欢迎注册LookLookWorld,',
        text: '你正在注册LookLookWorld,你的验证码为:' + yzm
    }
    //发送邮件
    transporter.sendMail(mailOptions, (error, info) => {
        if (error) {
            return console.log(error);
        }
        console.log('邮件发送成功 ID:', info.messageId);
    })
}
module.exports = sendEmail